At the beginning of "Children of the Gods", Apophis travels to Earth with his troops.
How did the Goa'uld know to return to Earth? How did they know that the desert gate had been dug up and was back in use?
Simple answer for me so far: He didn't know (that Earth got liberated).
At some point between movie and series, Apophis obviously learns of Ra's defeat. Given the low technology level of the Abydonians, it's unlikely that this is the result of an uprising, and even then he most likely has enough hubris to ignore that potential.
I've always had the impression that none of the system lords considered Abydos to be worth having a permanent presence on. IIRC Ra returns to Abydos to gather collected ore only. But why did he return in person with a ship rather than using the stargate? Is it possible that this has been one of his last few worlds or something like that? So it could have been "that bit of ore or nothing at all" for him?
Either way, since Apophis is looking for a new queen (host), he's obviously trying to scoure all of Ra's former worlds for potential candidates as well. For some reason, they visit Earth before Abydos, yet they didn't expect it to be a "fallen colony" (I'd assume he would have been far more cautious then). Ra would have never allowed for any other system lord to know that he's lost Earth (as well?), considering it would have been a clear sign of weakness.
But even if he'd know, they could have tried it just out of curiosity: It's shown several times, that nothing bad happens, if you try to dial to a broken or somehow dismantled stargate. The process will just cancel, similar to a phone that's in use.
So just try all potential worlds, one after the other, if the connection works, look for candidates, and then pick the next one.
It's reasonably certain that Apophis would have spies in the employ of his fellow System-Lord Ra and would have become aware (either immediately or shortly afterwards) that he'd been killed by forces unknown. His own spies would have heard stories of the liberation of Abydos and a description of the liberators.
Having identified that Ra was actually dead, he correctly identified the Tau'ri as the culprits and then used his own Stargate (either from one of the worlds under his control or from the Stargate on his mothership) to send a small expeditionary force to Earth, expecting to proclaim himself ruler of what he would recall was a relatively uncivilised, but heavily populated planet.
O’Neill was still slightly behind the curve. “The Stargate can go other places?”
“The aliens could have come from… anywhere.”
SG-1 - The Novel
Encountering unexpected resistance, Apophis made good his escape but not before he'd captured a hostage to interrogate.
The most logical answer for me would be that the Goa'uld did the same thing as the SGC reportedly did (Sam mentions it in a dialog with Hammond): regularly retry dialing gates that had been disconnected/buried. As Earth was the original human world it would probably be high on the retry bucket list.