A couple of ways. It compares the aircraft position calculated using MLAT and the SMR with an electronic map. It is also linked with the stop bars. If a stop bar is off and an aircraft crosses the holding point, no alert.
It also operates target to target. Imagine an aircraft on final. A-SMGCS builds a number of predictive "boxes" ahead of the aircraft. The size depends on speed. If the leading box touches another target on the runway, an alert is produced. The boxes rapidly diminish when an aircraft lands so there is a possibility that if there were a vehicle at the upwind end of a runway, the boxes may not touch it. In that case there would be an incursion but no alert.
For departing aircraft, if there is another target on the RWY, an alert is produced when the departure exceeds a system speed where it changes from being a taxiing target to a departure.