Usually companies working on pharmaceuticals have a range of potential medicines in different stages of development, all competing internally for resource. The company basically does spread betting on which candidates have the best chance of success, and they all inch forward, with great scrutiny and justification for investment in each stage. It's phenomenally expensive - Phase III clinical studies alone cost millions, well into 8 figures.
For the COVID vaccines basically everything was thrown at them. Staff were pulled from other projects, studies were run in parallel, which is risky because if one fails you've thrown money down the drain on the other studies rather than doing them sequentially one at a time. They invested in manufacturing processes and scale-up before knowing if it even worked, again huge financial risk if it didn't because these manufacturing facilities were not making other drugs while all this was happening
The mechanisms behind how each different vaccine works have been around a while, so once the virus was genetically sequenced the race was on to fit the virus to the mechanisms, prove they work and prove they can be manufactured. For the review of data, usually MHRA, FDA, EMA and others take about a year to review and approve a new medicine. Again, because of the urgent and unmet medical need, they too pulled staff from other activities and threw everything at it. They accepted data as and when each company generated it ("rolling review"), rather than having it all delivered all at once in one go.
An important thing to note is that no vaccine has got a license in this country yet - when MHRA says the are "approved for use", their technical language notes that they have "authorisation for temporary supply" which basically means they get a lot of scrutiny for each batch of vaccine and if at any stage MHRA is not happy, it gets yanked from supply immediately.