It's pretty straightforward once you understand the sometimes-tricky transclude.
ng-transclude basically just calls "element.append( transclude() )" in it's linking function, which basically just adds the transcluded content to the element that asks for it.
The way translcude() works is it looks up its parent chain and finds the first element that defines 'transclude:true'. Transclude() then returns that content.
In your first example, ng-transclude is defined on your inner element " <test-transclude-inner ng-transclude>". When angular compiles your outer element it sees this as the following:
-> test-transclude( new scope, transclude )
-> ng-transclude
And normally thats what you want!
But if you look carefully at <test-transclude-inner ng-transclude></test-transclude>, you will see that there is no transcluded content. ( Between the <>, there is no HTML! ).
Look now at <div><hr />2: <test-transclude-inner><div ng-transclude></div></test-transclude-inner></hr /></div>.
You will see that inside <test-transclude-inner>, you now have the <ng-transclude>. "ng-transclude" is now transcluded content. When your inner directive compiles, your "ng-transclude" in your inner directive will be replaced by "ng-transclude" from your outer directive. The ng-transclude directive will then correctly look up to its parent and transclude your intended content.
Hope that helps!
(transclude is a thing)