Like any digital data transfer, there must be a clock to move the data from the optical disk to the hard disk or SSD etc..
The clock in the CDROM drive reads the data in chunks at a high rate, (much higher than the sample-rate) that are put into a FIFO memory and then it is buffered in the computer memory. This way, the chunks that are spooling out on one clock frequency from the CDROM drive don't have to match the computer system clock.
Then it is moved from memory to hard disk storage using the computer system clock.
Once stored on hard disk, the ripping application can reformat or resample the data into .wav, FLAC or other formats and check both the data and offsets for accuracy by comparing these to other rip history stored on various servers on the web.