The energy of the wave exerts itself, pushing the water as far up to the beach as it can before gravity counteracts it and pulls the water back into the ocean. It’s the same reason that if you roll a ball up a slope it will only go as far as the energy you put into rolling it before gravity pulls it back down the slope.
TL;DR- Gravity.
Latest Answers