Step 1: Add all pages into a database, otherwise how are you going to navigate to the page when you click it?
Step 2: Make sure each page has a parent/hierarchy to be able to do some SQL on.
Step 3: You're done!
N.B. If you are trying to do this on static html files and want to build a tree around that then you will probably have to do the breadcrumbs statically too. Or you could always add them into an associated array and do it all in PHP.