Well Pakistan cannot be compared to BD as the former is multi-ethnic and the latter is mainly of a single-ethnic group. Look round the world and the single-ethnic countries do better than multi-ethnic ones economically.
Pakistan had those 24 years between 1947-1971 where it was able to use BD resources to enrich itself. No surprise that after BD left in 1971, Pakistan has mainly done poorly and is behind BD now in all indicators apart from military strength but the 2 countries have different needs in terms of military power. Pakistan is somewhat disadvantaged economically over BD as it has to spend far more on the military over BD due to it's relations with India over Kashmir.
Pakistan needs to get rid of its feudal system, better educate its population and carry out major economic reforms as otherwise it will be left behind India significantly by as early as 2030, let alone BD which is powering ahead economically at rates only seen before in East Asia.