How accurately can an ESC detect the number of RPMs?
In theory, an ESC can precisely know the RPM, since it's the ESC that provides the RPM.

The whole way that a brushless DC motor works is about exciting individual coils.  As subsequent coils are turned on / off the magnet is pulled around the circle.  Only when all the coils have been used in turn has one revolution takes place.

Since it's the ESC that is responsible for creating that sequence of coil activations it's the ESC that dictates exactly how fast the motor is turning.

But the real question you should be asking is, can you control the RPM setting of the ESC to any great accuracy?