Without any first hand knowledge of the technologies involved, I can only suppose that any browser based speed test can only measure the throughput between the browser and the server providing the test service (at fast.com, in this case).
The speed reported would be the lowest speed (bottleneck) anywhere between the browser and the server.
If the WIFI speed between your PC/laptop/whatever and your in-house router is slower than the speed between your in-house router and your ISP, then the WIFI speed would be the limiting factor and that would be the highest reportable speed.
If you have blazingly fast WIFI connectivity locally but your connection to the ISP (cable modem or whatever) sucks, then the best speed you will get will be the ISP speed and that is what would be reported.
If, for some reason, your computer itself is ridiculously slow, that might be the bottleneck.
The slowest link in the chain will be the max reported rate.
fast.com says I'm getting about 87 Mbps. Since a wifi user right close to my router is getting five times that, I suspect that somewhere in my house there's probably an ethernet wire that's only good for 100 MBPS. Maybe time for some new wires!