Like anything else, you get what you pay for.
I have cruised several times on P & O liners, and they do have formal dress nights, as well as semi-formal and casual nights.
It is explained throughly in the ship's info log in your cabin, but as a guide -
'Formal' means a dinner suit for men and an evening dress for ladies. Bowtie colour is optional, but a dinner jacket and trousers are expected. If you turn up underd-ressed, you will feel seriously conspicuous, as about 1% of diners do not conform to the dress code.
'Semi-formal' means a suit with a tie for men, and a nice dress for ladies.
'Casual' means open-necked shirts for men, and a dress or trousers for ladies, but it does not mean jeans tee-shirts and trainers, that is considered a bit too casual!
If you want a high-end cruise, but not to dress for dinner, then there are plenty of otjher eateries on board which have no dress code at all, so you only have to dress for the formal dining rooms on the nights indicated.
I can't speak about the 'no code' ships, i am very ,ucky enough to be able to afford to the 'formal' cruises, and we regard the formal and semi-formal nights as a part of the pleasure of cruising.
As i said, some people do flout the rules, but the do get stared at, and must feel uncomfortable being in a seriously small minority - or maybe not, if you ignore a simple courtesy to your fellow diners, you probably don;t care what they think of you!
The high-end cruises attract seriously monied travellers, most of who cruise five or six times a year. Speaking as a 'once every few years' after some hard saving, I do enjoy rubbing shoulders with the seriously wealthy, and chatting with them - you will be placed on a dinner table for four, six, or eight, so you dine with the same people each night. If you don;t get on, you can ask to be moved.
Have a great time!