How does Wordpress know it's powering 40% of all sites in the world? Where does it get the stats
Also someone posted this thing a while back that does some detection like this to find out what tech is powering the website you are on:
I'm not related to them in any way and I don't know how accurate it is but it was interesting.
I bet they are undercounting a bit since the large content sites will keep their WordPress install outside of public view completely and the site is just headless.