Basically Nintendo owns the rights to the Pokemon franchise (names, characters, stories, etc), and also handles the printing/distribution/orgaized play through it's subsidiaries.
Wizards of The Coast holds the patent for TCGs: any company wishing to publish/distribute it's own TCG has to either go to Wizards to do it, or arrange a fee with them. When WotC's license to make and distribute the Pokemon TCG ended, and Nintendo continued by themselves, WotC got their legal team involved and the mater was settled out of court. Whether this means Nintendo trumped the patent and WotC decided to drop the case, or Nintendo ended up paying out to WotC isn't clear.
So while Nintendo owns Pokemon, makes the cards, distributes the cards and takes care of organized play, WotC may still "own" part of the TCG.