Keep at bay
Prevent, either a person or an event, from advancing nearer.
'Keep at bay' (sometimes used as 'hold at bay') is one of those expressions that we are likely to know the meaning of because we have picked it up from colloquial use in our youth and worked out the meaning from the context it was used in. The nature of how we learn language allows us to gain a knowledge of what an idiom means without necessarily knowing the meaning of the words contained in it - which I guess is why pages like this one get readers.
Anyhow, back to the phrase itself. It seems plausible that 'at bay' is a nautical phrase and that the allusion is to a ship that is anchored in a bay and waiting to enter a port. 'In the offing' has pretty much the same meaning. As it turns out, we only need one expression in English for that circumstance and 'keep at bay' derives from a completely different place.
The Old French words 'abbay' or 'abai' mean 'barking'. These came into English, first as 'abay' and later as 'at bay'. Hounds that were barking were said in the 14th century to be 'at a bay'. This is recorded in the English romantic story Guy of Warwick, circa 1330:
Into a forest þat swine him ȝede. Into a ficke hegges he gan him hede. Þer he stod at a bay.
(A fat boar went into a forest. He hid in a thick hedge. He [the hound] stood there barking.)
To keep at bay meant then to be in a standoff with a baying dog that was intent on killing - a scenario which also gave us the expression 'baying for blood'. In more placid moments hounds also 'bay at the moon'.
In recent times the phrase 'keep at bay' has taken on the more general meaning of 'fend off'. The earliest example that I can find of the modern 'keep at bay' (as opposed to 'at a bay') and which doesn't refer directly to hunting with dogs is from The Derby Mercury, February 1759, in a report of England's war with France:
We have seen the French kept at bay for the whole campaign, and they are gone into their winter quarters.