MASS AND ENVIRONMENT AS DRIVERS OF GALAXY EVOLUTION IN SDSS AND zCOSMOS AND THE ORIGIN OF THE SCHECHTER FUNCTION