Microfoundations of Population Dynamics