Bro even Sweden with a population less then Karachi can make and export its own planes. Its not really an economic giant.
Sweden doesn't manufacture jets from scratch. Many of the Gripen's inputs come from overseas, e.g., engine, flight control system, etc. It's quite difficult to indigenously produce a fighter without a deep industrial base for gas turbines, steel, composites, etc. Sweden has some of those inputs, but not all of them. E.g., it uses GE engines, British electronics, etc.
However, Sweden does do design and management pretty well. So, with the Gripen, the Swedes designed the jet such that they could pick out the best, low-cost Western inputs available on the market. As a result, the upfront cost of the Gripen is markedly lower than other Western fighters. So, while it's not indigenous, it avoids some problems of importing a foreign design (e.g., where you're stuck with certain suppliers).
This is what the PN is doing with its projects. So, with the Jinnah-class frigate, for example, we'll still import steel, electronics, propulsion, etc, but we'll choose our suppliers directly. As a result, the PN has more control over things like cost and, to an extent, being sanction-proof (by being able to switch suppliers through internal re-design work).