Tanks of course didn’t exist before WW1. But when tanks arrived in the scene, then an anti-tank mine was needed quickly. Here’s an early German one, showing an artillery shell mounted in a wooden box that would be buried in the ground. A cross-member is laid across the top of the fuze and would exert a crushing force downwards on the fuze initiating the device.
Of course this wasn’t the first time that artillery shells were utilised in IEDs – Here’s one from the US Civil war. But I suspect the principle is the same, utilising the pressure of a tank track to impinge on the armed fuze of the artillery shell, buried in a box.