How are airlines able to work out gate allocations so far in advance?
Route times are pretty well known. If you know when the plane should depart and how long the flight should last, it's pretty easy to calculate when it will be arriving. Give a few minutes leeway on either side, and you should be good. If the plane is not there on time, you send it somewhere else.

Most large aircraft have some sort of ACARS that allows them to talk to company dispatch and let them know if they're going to be early or late, among other things. Barring that, they almost always have a company radio frequency that they can relay messages on one way or another.