
It is generally agreed that the most critical part of a production is capturing the sound, in other words, the recording itself. This does not mean that the other stages are secondary, but they are less decisive, in the sense that they generally do not represent a point of no return and you can always retrace your steps and fix things. Moreover, in editing, mixing and mastering you can improve a recording (and, as we all know, make it worse too), but you cannot turn a bad sound into a good one.
On the other hand, it is not always possible to re-record certain parts or instruments we are not happy with, due to limited resources: time, personnel and money. Nor is there any guarantee that, however closely we reproduce the environment and conditions of the original recording, the result will be consistent with what has already been recorded. Therefore, all the time we devote to placing the instrument in the room, choosing and positioning the mics, pairing them with the right preamp and setting it ideally, and directing/producing the musician (to get the best possible takes) will definitely pay off in the final result.
Beyond all of the above, I want to stress that the recording stage is, to a large extent, when the sound the producer wants to give the album is "built." This is something that is forgotten far too often. It is the personalization of the sound that has turned records like Nirvana's "Nevermind" or Pink Floyd's "Dark Side Of The Moon," to name just a couple, into cult works.

Nowadays, with sequencers and prerecorded samples, we can make productions in which practically only the vocals, backing vocals and guitars end up being recorded (and the latter are starting to be replaceable by virtual instruments with some decency). So in some studios and for some projects (and don't think only of low-budget productions…), miking has taken a back seat. The advantages are clear: it is cheaper, it takes less time, editing practically disappears (although there is much more programming) and, by using samples, someone else has taken care of the recording for us. The drawbacks are equally clear: sadly, the role of the performer disappears; no matter how well it is programmed, that machine-like "whiff" creeps in; and, just as bad or worse, the sound of every production ends up being excessively uniform. It is the "globalization" of sound.
Drums
Among studio engineers there is a maxim that we take very seriously, which says that "a record can't sound better than its drums." It applies completely to live sound and probably to the drummer as well (a band can't play better than its drummer). And this is where things get complicated, because if miking an instrument with a single sound source already has its tricks, when there is more than one the difficulty grows considerably. Where does all this difficulty lie?
On the one hand, when we have an instrument made up of more than one piece, like a drum kit, the overall sound is the sum of the sounds of each of the parts plus the interactions between them and, of course, it also depends on how the instrument interacts with the room in which we capture it. A drum kit does not sound the same in a live room as in one with walls covered in absorbent material. We perceive the sound as a whole, with a small degree of stereo spread that narrows as we move away.
On the other hand, curiously, the tuning of the parts, the technique the drummer uses to get sounds and the balance of volumes are all done by the drummer from his own position. So should we capture the sound with one microphone? Or with just a couple? As many as there are pieces in the kit? Where should we place them? Will they "get in each other's way"?... In reality all the options exist, depending on how we want the drums to sound in our production, and depending on the choice we make, we will have to deal with the associated problems.
One piece, one microphone
This is the most widely used technique today for recording drums for pop-rock and rock productions. It allows intensive, individual processing of the sounds, yielding punchy, well-defined drums with plenty of creative leeway, although sometimes very far from reality. The microphones are usually placed close to the head, so the sounds captured are not what a person hears from some distance away, but it guarantees a certain isolation from the other sound sources.

The main drawback of using many microphones is that, inevitably, the sound generated by all the parts being played leaks into all of them to a greater or lesser extent, so phase problems that cause frequency cancellations are very common. This is especially important in the lowest parts of the kit and, very particularly, in the kick drum. You have to invest all the time needed to find the optimal positions and arrangements of the microphones to minimize phase problems between them. You also have to invest time in tuning the kit, a task that should normally be done by the drummer but that we cannot ignore. One of the great lies of our industry is "don't worry, we'll fix it in the mix…", unless we constantly resort to Soundreplacer, but that's another story.
The number and type of microphones used vary a lot, but it is common to find a setup similar to the one I describe below
Kick drum

A dynamic microphone with extended frequency response in the low end of the spectrum. It is placed slightly inside, pointing toward the pedal, but not too close. It is usually EQ'd to emphasize the lowest part and add some character to the high end of the attack (the beater hitting the head), while cutting the low mids to remove the muddy part of the sound and add definition. It is common to compress and also to apply a gate to adjust the length of the sound's tail. This also helps cut unwanted harmonics from the mix.
A second microphone can be added to this basic setup, aimed at the batter side of the kick, pointing where the pedal strikes. It adds character to the attack of the sound, but you have to be careful not to throw the two sounds out of phase and to keep the mechanical noise of the pedal from spoiling the cleanliness of the take.
Another variation is to add a second, condenser microphone outside, at the front, placed a little over a meter away (you have to keep trying until you find the ideal position where no phase problems appear). This lets you capture a sound closer to what we would hear and produce an overall sound much closer to reality. Finally, it is worth noting that for some time now it has been common to find studios that use a speaker as a microphone (after all, it is still a transducer, just with the process reversed) to capture, in particular, the sub-lows a kick drum generates.
Snare
A dynamic microphone with a high SPL (sound pressure level) handling, tilted at around 45º and pointing roughly toward the center of the head. It is preferable to make few EQ corrections and leave them for the mixing stage, where we can better see how the different microphones interact. It responds very well to compression with fast attack and release, although caution should be the rule.

Compression is not reversible. So it is better to add it in small doses, avoiding overdoing it. We can always add a little more in the mix, and bear in mind that compression comes into play again in mastering. It is common to add a microphone with similar characteristics on the bottom head, in an almost symmetrical position but 180º out of phase. It helps give the snare sound a metallic color by capturing the snares much better. A gate can be used to control the tail and/or the harmonics, although I am not a big fan. It is better to tune the whole kit well and let the snare's signal decay naturally.
Hi-Hat

Although, due to proximity, a lot of hi-hat gets into the snare microphone, it is preferable to capture it individually, with a small-diaphragm condenser microphone pointing outward, away from the snare. It is common to EQ it with a high-pass filter to better isolate its own frequencies and discard what "leaks" in from other parts.
Toms
As with the snare, dynamic microphones that can handle high SPL are usually used. They are aimed at the center of the head, tilted at around 45º, and they are probably the hardest parts of the kit to mic. A great deal of their sound gets into the overhead mics and, in turn, their microphones pick up almost all the rest of the kit. It is better to record them clean (so as not to lose information), with light compression and an EQ correction that removes the typical mud at 200-300 Hz. Once in the mix, they should be fine-tuned with more EQ, compression and gates, depending on how they interact with the rest of the mics, especially the overheads.

Floor tom
Practically the same as the toms, except that its lower sound has enough energy to make the rest of the kit resonate if all the heads are not properly tuned.
Overheads
Also called aerial mics. Condenser microphones are placed above the kit forming a stereo pair. There is a mistaken idea that they are meant to capture the cymbals, so they are usually high-pass filtered to try to remove most of the sounds coming from the rest of the kit.

In reality, the overheads are responsible for the overall color of the drum kit. They can be EQ'd so the kick is not picked up excessively, avoiding phase issues with it, but it is more important to find the right position and ensure good phase alignment with the other parts. The sound the overheads add is what makes a drum kit sound natural. They are the only microphones (along with any room mics we add to capture the acoustic response of the space) that receive the fully formed sound, in a way similar to how we hear it when we listen to a drum kit standing next to it. Because let's be honest: does anyone climb inside a kick drum to listen to it? Or put their ear 2 cm from a snare head? Obviously not.
Conclusion
Not long ago I took part in recording an album by a Spanish artist on which the whole band played at the same time. The studio where all the basic tracks were recorded, Musiclan, has a room with enviable acoustics, and the producer (one of the greats in this country) decided that, given the concept of the album, the drums should be captured with just one microphone above the drummer's head, along with two room mics placed several meters away and high up. The result… simply spectacular. What I mean by this is that everything described above should be open to experimentation.
Where I have used dynamic microphones, others will use condensers, or place them in different positions. The same kit can be miked with 4 microphones or with 12 and still get exactly the sound you are after. One setup is not, in principle, better than another, as long as it sounds good, meets the client's expectations and the person in charge of the recording is able to handle the problems inherent in that setup. It is essential to try different arrangements, microphone types, instrument positions in the room, preamps, etc., until you find the point where the sound you capture is exactly what you are looking for. In any case, theories aside, it is worth remembering that "if it sounds good, it is good." That never fails.