The X Factor: good for all, but difficult
This is probably the rarest case, but also the most profitable for both parties - when you combine two jobs in the same company. You don't hide from anyone, everyone knows the situation.
For example, you work as an analyst and additionally take on the function of project manager. It is also not uncommon for developers to move into management as they develop professionally. The second option is when you change the programming language and leave, for example, from frontend development to backend. If there are places in the company, in order not to lose income in a junior position, you can stay in your current place, while developing in a new direction.
The employee gets the opportunity to develop and practice new skills in their company, where they are familiar with the business processes. In addition to development, you will also get more money. The disadvantages are overwork because it is not easy to play two roles at the same time, more work hours are added.
In the case of an employee starting to perform management tasks, the company gets a manager-practitioner who understands the problems of employees, how they work and, often, such a person has well-developed communication with the team. If you change professional direction and stay with your company, you are more loyal and familiar with internal processes. You don't need to be introduced and adapted. The disadvantage for the employer is the constant risk that you will burn out, get tired and fail to meet the deadline.