While modern tanks and most other armored vehicles are too well protected to be affected by anti-materiel rifles, the guns are still effective for attacking unarmored or lightly armored vehicles.
The origins of the anti-materiel rifle go back to the First World War, during which the first anti-tank rifles appeared.