Always wondered this.
I used some trousers in my old job which had kneepads.
Hard shell outer, foam inner that sat in a pocket.
Velcro tab behind the knee to secure with drawcord in pocket allowed the trousers to be adjusted so that pad sat in the correct place.
Stretch panels around the knee and waist to enable everything to stay in place when under tension from use and load.
Not sure how they’d fare in a crash but worked a charm for my role.
Let’s also talk about pocket placement and why the hell they insist on putting pockets in the fold of your hip/thigh too?