Bit of both. Gentry were traditionally land owners in a constituency but industrial barons later were almost given constituencies in return for their support.
In more recent times, people transfered from other professions to politics.
Thats become less prevalent as has rising through a local council and going on to become MP.
The last thirty years has seen the rise of the career politician more, who are detached from the constituency they are given. People who are loyal to the party are gifted the safe seats or ones which have a realistic chance of changing hands. Those which are a lost cause are given to pretty much anyone they can get.
In more recent times all three major parties have struggled to find enough candidates to stand in every seat. They send out begging emails to members. Thats one reason you end up with a number of very dubious candidates.
Ironically standing in a seat you stand no chance of winning is a pretty miserable experience. You still have to put in appearances and do leg work and you get loads of abuse for your hard work. You get next to no support from the party and very often you have to put in money from your own pocket to help fund your campaign. And you know you arent going to win and the ambition might merely be to get your deposit back.
Honestly the whole thing is a miserable shit show that favours people with inherited wealth or those who wouldn't do well in other careers.
Ironically I controversially think the MPs wage doesn't attract the best talent either. Its high but its not necessarily helping resolve matters. The career politicians have the best and safest seats. We desperately need good people with understanding of certain areas of business to go into parliament atm. Particularly IT. Yet if you are good you can easily earn more in the workplace. And then you do 5 years only for you to be dumped out 5 years behind in your career. Why go into politics unless you are an idealogue? We aren't getting moderates with skills and experience and those we do, don't last in parliament either. Partly because the media is also driving ever more extreme narratives due to click bait too.
I do think a massive overhaul of how we fund and run politics is long overdue.
In other places there are caps on donations to parties and instead everyone had a state sanctioned budget to even things out for starters.