It's an old saying. The ability for submarines to move through water has nothing to do with swimming, and AIs ability to do generate content has nothing to do with thinking.
The quote (from Dijkstra) is that asking whether machines think is as uninteresting as asking whether submarines swim. He's not saying machines don't think, he's saying it's a pointless thing to argue about - an opinion about whether AIs think is an opinion about word usage, not about AIs.