I was trained that minefields are laid to optimize the manpower needs of a defensive line. Mines should be used to funnel enemy forces to locations that give you a geographic or firepower advantage. You have to provide cover fire all along the line to discourage and prevent sappers from removing the mines and making lanes through the minefield, like @RDCanecutter said, but it doesn't really take a lot of firepower to cover a minefield. Then you can concentrate more of your forces in the rear to respond to serious problems within the minefields or, if the minefields are set up correctly, bring concentrated fire on the areas to which the mines channel enemy forces. Done correctly you can force the enemy to come on in column so that they can only attack on a narrow front. This will let you put more firepower on them than they can bring on you, and allow you to defeat them in detail. Kind of like "crossing the T" in naval warfare.
Infantry on the defense love mines. Infantry on the attack despise them.
ETA - And I just realized that I didn't answer your question. You defeat a line like that by finding the weakest points in the minefields, concentrating suppressive fires there, usually a combination of infantry and artillery, and letting your sappers clear lanes through the mines through which you attack. You are still attacking through funnels (the cleared lanes) but you are picking the location of the attack. It's bloody, slow, and dangerous work, but that's the business. Read about the Battle of El Alamein to get a good idea of mine warfare.