Text is expanded in PDF and HTML exports. When you export the page to PDF or HTML, the text between the macro tags is expanded so that readers can see it in the PDF and HTML versions of the page.
Nesting your Expand macros. You can put one Expand macro inside another, and Confluence will correctly show and hide the contents of all Expand macros, including the nested ones.