I'd imagine that security have some kind of real time database which is checked whenever a boarding card is scanned. If a flight is leaving on time then passengers running late will not be allowed through. If a flight is delayed by an hour or less then it may already be assumed that all passengers would be be airside already and checked in at the normal time. If there is a very long delay which results in the airline keeping check in open for longer (say a delay of around 4 or 5 hours where passengers are informed in advance and advised to turn up later) then security will stay open for longer allowing everyone to get through in reasonable time.