Sometimes as a smaller nation it can be very difficult to repel a larger nation. While defence posts normally act as slowdown for an enemies movement, it does nothing to prevent or punish the assault.
Mines would resolve this. Either through a separate building or by upgrading a defence post, the mine would be able to more effectively repel attackers. One an invading army claims that land the mine is on, it would detonate destroying some of the attackers infantry and also destroy the land. This could be placed on the front to dissuade attacks and also on coasts to prevent naval invasions. The naval force would be destroyed.
This could also lead to advanced strategy where a weaker force is sent in to trigger the mine before a larger force is sent to engage.
As a balance feature, perhaps after a certain time has passed the mine detonates to prevent super turtling