Ignorance is bliss. Similarly, smarts smart.
I always figured that smart meaning sting was related to the German Schmerz (as in Weltschmerz), but that smart meaning intelligent was something else altogether.
It turns out that the latter has the same etymology as the former and is just the result of a slight shift in meaning.
OED has a cite from 1225 for smart meaning painful, and c1300 for smart meaning intense or vigorous, 1330 for smart meaning lively, speedy etc.
There’s no use of smart meaning intelligent until 1570 but I suppose that’s the chain of meaning. Painful -> intense -> speedy -> intelligent.