when your beef patty meets some heat, the amino acids and sugars within it begin reacting, which results in changes of flavor and color. so when you "smash" your burger patty down, you're creating more surface area for the maillard reaction to take place.