I am creating a vertical search engine and most of my pages are dynamically created using a script. How can i make these pages "SEO friendly" ?

Example:

Trulia.com
http://www.trulia.com/GA/Buford/

This page lists #1 on google for "buford real estate". How does google know to choose this page instead of another dynamic page, say:

http://www.trulia.com/GA/Buford/#for.../new_homes_lt/

Is it only due to the sitemap and internal linking within trulia.com that google determines that /GA/Buford is the main page for "buford real estate"?