Inside organizations where the organizations are small it is easy to move. Just start working on something, and over time you'll be the expert of the domain. Other people will come to you for knowledge and experience on the broad domains and you will move up. There are often terms like "blue ocean" or "green pasture", meaning there is much variety and room to expand.
Inside organizations where the organization is large it becomes difficult to move. You get assigned to work on a task and there is little or no time to master any larger domain. You end up becoming expert on a small domain, and since few people use the domain the career starts to stagnate. It is difficult to take on additional areas because there are entrenched experts and your assignments limit you. The term is a "pigeonhole", a small compartment that limits your career.
It can be difficult for organizations to offer much growth, much "blue ocean" and "green pasture", as they get bigger. That doesn't mean it cannot happen, it just requires effort and many companies don't want to do it.
It can be a very real problem as organizations grow.
I think the hardest part is just awareness. Individual workers and their managers need to communicate about when someone is feeling pigeonholed or may become pigeonholed. Just because someone has written network interfaces for the past two years does not mean the individual wants to make that their entire career. However, some people DO want it to become their entire career. So talk with managers if you want to grow. Start out simple, "I feel pigeonholed. I would like to also grow into these other areas." If you are concerned about becoming trapped, perhaps "I did that last project. I'll certainly help out in that area, but I need to work on other areas in this new project."
There are managers who THINK you enjoy doing something even if you don't. There are managers that even when you tell them to their face 'I want to do something different, please reassign the work" they'll still assume that because you are the most efficient (due to experience) all the work should go to you. Once that happens, sadly, the best options become through the HR department. Sometimes the individual needs to go to HR and explain that they aren't satisfied with their current role and want to move to a totally different role. Sometimes the individual just needs to move to a different company.
It absolutely happens that people get trapped inside organizations. First the person says "I would like to be transferred, you aren't using my skills." Then some time later "I need you to transfer me". Then, before any transfer happens, the organization lays off the worker because the thing is no longer relevant and organizations currently prefer to train new (cheaper/younger) workers rather than move experienced (expensive/older) workers laterally.
It can be an organization wide issue. I think that if the organization is aware of it, and the organization wants to prevent it from happening, the organization can take steps to prevent pigeonholed employees. Organizations can ensure that people spend a portion of their time on tasks outside their typical domain, that people are allowed opportunities for personal growth, that people are allowed to exercise their imagination and creativity outside of strictly assigned roles.
While I understand some of the mentality, I see it as a retention issue. You will not be able to hire and retain the best workers when your existing workers are pigeonholed.
There are questions you can ask during interviews when you change jobs to help detect it. "How often do people change roles?" "How long have you (individual peer) been in this role, and what were your prior roles?" "What did you (individual peer) focus on during the last several projects?" "What is the employee turnover?" "When was the last layoff, and how many were terminated?" "Why are you hiring for this role?" "What happened to the person who used to have this job?" If everyone is stuck in their job it is a sign of stagnancy. If they recently laid off people but are hiring for a role because it never existed before, it is a sign that they won't allow people to move laterally. Look at the age of people. How many people are over age 40? Over age 50? Over age 60? I've seen too many studios where "old" happens at age 35, or where there are only a handful of 40+ individuals plus a bunch of H1B workers, where the organizational philosophy is to just pigeonhole, fire, then replace with this year's round of cheap labor. Keep your eyes open.
Finishing this post out, this is actually one reason I prefer small companies over big companies. In a five person startup everything is a growth opportunity. Finding growth opportunities in a 30 person company is easy if you talk to those in charge. Finding growth opportunities in a 200 person company takes effort but can still be done. Finding growth opportunities in a 1000 person cubical maze is not really possible, those are great environments for hiding incompetence and any growth you make serves as a hiding place for roaches and leaches within the organization.