When people first start riding, they rarely have any training philosophy other than “just go out and ride”. And initially, that’s enough – the mere act of riding at all puts a fair amount of training stress on your system, and you therefore improve.
But as you start to ride more, you’ll get to the point where your body has adapted to the way that you are training. Or, to put it another way, the workouts that you are doing aren’t putting sufficient stress (or, more specifically, the right kind of stress) on your body, so you get stuck.
At this point, most people try to ride more/harder, which can achieve some gains, but you will rapidly reach the point of diminishing returns.
To make further gains, you need to switch to training that can stress your body in specific ways, so that you can improve in those individual ways. Together, those improvements will make you faster.