Turkey has a substantial Kurdish minority which (accurately) believes itself to be mistreated by the Turkish government. The two sides coexist about like the Israelis and the Palestinians do - they don't like each other and are occasionally violent.
Kurdish militants (viewed by Turks as terrorists) have sought and received asylum in Sweden. This irks the Turks.
Following the Russian invasion of Ukraine, long-time neutrals Sweden and Finland both decided to join NATO. All NATO decisions are made unanimously and member Turkey balked at their joining, claiming both nations befriended an enemy of Turkey - the Kurds.
Finland somehow made peace with Turkey and was allowed to join NATO. For internal political reasons, Sweden couldn't give Turkey what it wanted and Turkey has stonewalled until now.
NBC News reports that Turkey has given in and will allow Sweden to join. Their source is NATO Secretary General Jens Stoltenberg. Reading between the lines, it appears Sweden has agreed to be less of a haven for political refugees than heretofore.
With Sweden joining NATO, the Baltic Sea becomes for all practical purposes a NATO "lake." Russian naval vessels will only be able to operate out of St. Petersburg and Kaliningrad insofar as NATO and Russia remain at peace.
The wartime military usefulness of both Russian ports just dropped to essentially zero. This poses an interesting dilemma for Putin to either move his navy elsewhere or sacrifice it if he chooses to attack NATO. And if he does move it, won't that be a "tell" that an attack is anticipated or planned?
Later ... Rumors suggest Secretary General Stoltenberg may have promised President Erdogan more than he is able to deliver. What's more, he likely did it knowingly. The fallout of doing so is hard to predict.