While I was studying about the working of transistors I came across a term called the depletion region which stops the flow of electrons from one place to another. A doubt that came to me was why couldn't the majority carriers form a depletion region?
You don't mention a specific type of transistor so I am going to explain generally only the physical principles.
You can think of a transistor as two connected pn junctions.
You have holes flowing from the p-type region to the n-type region. Also you have electrons flow from the n-type to the p-type. When holes reach the n-type region they will disappear with electrons. So in the n-type region which was electrically neutral now there are going to be positive charges. The same thing happen in the p-type only with negative charges.
More precisely when you have the holes flow from p to n upon arrival in the n region they will be the minority carriers and the electrons the majority carriers. When there were no holes the n-type region was electrically neutral. Now the minority carriers (holes) disappear (connect) with the majority carriers (electrons) so now the n-type region is positive charged. As I mentioned the same goes for the p-type region but with negative charge at the end.
The formation of the depletion region in a pn junction:
A pn junction in forward bias:
And in reverse bias: