They use a tiny MEMS gyroscope to measure RPM. These are solid state devices that can measure axial rotation so it can count how many rotations per minute the bike’s axle is rotating. The actual structure of the MEMS gyro is quite interesting (and different from a MEMS accelerometer)- there’s a good description on Wikipedia.
Because the gyro is measuring axle RPMs and not speed directly, it does somehow have to know the tire size so that it can convert RPMs to travel speed. See further discussion below.
Many MEMS gyros are packaged with accelerometers (the combo gyro/accelerometer is called an IMU) and there are also some with compasses, some with barometer/altimeters, and some are in the same package as GPS sensors - although GPS uses much too much power for a tiny device that is operated by coin cell batteries, so the Wahoo most definitely does not have GPS built into the sensor. If all you’re measuring is speed and you already you know the tire circumference, then all you need is a basic gyro unit. However, IMUs have become really cheap due to their implementation in cell phones and they allow for more flexibility than gyros alone.
The OP clarified their device doesn’t need the wheel size so it’s either 1) using an IMU to analyze accelerometer data to calibrate the wheel size internally against the gyro -- or 2) it's using the receiver/phone's GPS to calibrate wheel size.
1) Using just the accelerometer on an IMU isn’t going to be as accurate as using a direct measurement of the wheel. It's hard to accurately measure velocity from acceleration data, especially when your sensor is also rotating slightly off-axially in space on a bumpy road -- and so to 'cheat', the sensor CPU is likely doing a rough calculation and then using the closest pre-set in an internal table of values (i.e, one pre-set for 700c wheelsets, one for 26", etc. but it wouldn't be able to tell a 23mm tire from a 28mm tire). However, because most people don’t accurately measure their wheel circumference anyway and just use preprinted cheat sheets anyway, the loss in precision isn’t really of great concern to the end user (see manual calibration note at end).
2) Using the GPS in the receiver would be the most accurate way to calibrate wheel size, especially over longer distances as you can precisely divide (say) 1000 meters by the number of revolutions to get a measurement of wheelsize accurate to 1% (GPS is accurate to about 10 meters) - although any bends or curves would greatly throw off the GPS measurement of linear distance.
Where these inertial units are the most helpful for end-users are in conjunction with GPS at very slow speeds or curvy roads where the GPS has trouble tracking speed-over-ground or measuring distance-over-ground over bendy roads. The data from the IMU can help the receiver better calibrate and ensure that you're properly credited for all those slow, tight hairpin turns as you get KOM.
Note: looking at the manual for the Wahoo, there is an option for entering the wheel circumference directly for when the automatic measurement fails.