The Taliban have had many recent opportunities to learn how to fight a good insurgency in both urban areas (from Baghdad/Diyala/Mosul/Basrah, etc) and rural, desert areas (Afghanistan, Anbar). There's a lot of smart stuff they've been doing in Afghanistan to keep NATO off-balance. But in Pakistan, their mistakes are starting to grow--and show.
Part of the problem is context. The Taliban are recycling some old concepts that have worked in the past, but are not particularly useful here. The two of note are its strategy in Mingora, and its attack strategy in Lahore and Peshawar.
The Taliban Mingora strategy--to sit and hold--had worked before. Ineffectual Pakistani Army attacks in the past balked at real resistance and urban warfare, dissolving before damage was seriously done. Further, such defeats crushed morale and domestic support for military operations. Doing the same seemed wise enough, but the Taliban did not estimate the ire they had caused among the Pakistani people. With domestic support, the Army was able to send a sufficiently sized and resourced force to retake Mingora rather easily (much more easily than the US took Fallujah). The Taliban were not prepared.
Perhaps as importantly, the Taliban offensive strategy is almost certainly a mistake. They're taking a few pages out of the al-Qaeda book, trying to intimidate the population into submission with attacks (although on police) in multiple cities: Lahore and Peshawar so far. Islamabad is probably next on the list of targes. The idea, of course, is to let the population know that they are not safe as long as they continue to assault--that the Taliban can hit anywhere, at any time. This isn't strictly-speaking true, but they certainly want to give off that impression.
Unfortunately for the Taliban, such attacks are likely to bolster the emerging story told in Pakistan that not only is the Taliban a major threat to Pakistan's survival, but they're an urgent threat to the individual citizens of Pakistan right now, and must be cleared sooner rather than later. When dealing with a committed enemy, minor hurts tend not to deter them--only enrage them. If the Taliban is going to try and beat Pakistan at this point, it will either require staying sufficiently below the radar that the current commitment dissolves, or require destroying their capability right now--which is highly unlikely. But after years of offensives, the Taliban may not have the patience nor the wisdom to be able to seep back into the walls and make themselves hard to hit. Hard-won territory in Swat and Waziristan will unlikely be easily given up--but by choosing to take the Pakistanis head-on and agitate their population, the Taliban show a level of desperation to keep their position that will ultimately be detrimental to their cause.