Why is querying posts messing up my pages?

use wp_reset_query after your loop to restore the global post data for the main loop.