RAID works at the "block" level not at the "file" level.
HDD's are divided into a number of fixed sized "blocks." When you store a file the file system will allocate the required number of blocks from a pool of "free" (unused) ones on the disc to contain your file, chop the file up chucks that fit in each block, the send them off to the disc and record which blocks are used and in what order in the file system catalogue.
So, say I've got a disc with 1K block size and I want to store a file of 2.5K. The filesystem will "find" some empty blocks on the disc from it's pool of "free" ones, let's say block numbers 9, 4 and 7 (no significance to these number, I've made them up as an example) store the first 1K of my file in block 9, the second 1K in block 4 and the last 0.5K in block 7. Finally the catalogue will be updated to list "myfile.txt" as residing in blocks 9,4,7 (in that order) with length 2.5K. You will note there's a bit of "wastage" in that the last block in the sequence is not filled.
In a RAID 1 ("Mirrored") array using two discs, the block structure is replicated identically on all discs in the array. So literally every block on disc A is identical to the same block on disc B.
Thusly, if one of the discs dies, the files can still be read from the surviving disc as both discs are the same. When don't (colloquially) call RAID 1 "mirrored" for nothing.
When you replace the failed disc, the RAID controller will reconstruct the array by copying the contents of the surviving disc onto the new one. The bigger the discs, the longer it takes so your array will still be "at risk" until the rebuild is complete.
Other versions of RAID use different paradigms and for some of them it is not that the case that you can pull a disc out of the array and still read it. RAID 0 for example, "distributes" disc blocks across the array without any redundancy. For example in a two disc RAID 0 stripe, all the "even" numbered blocks might be on disc A and all the "odd" numbered blocks might be on disc B so if you drop a disc on a RAID 0 stripe you loose everything because quite literally every other disc block (including those that conatin the catalogue) have gone missing and you cannot recover anything.
There are lot's of variations on these themes, this is just the basic fundamentals.