Understanding Display Ribbon Cables and compatibilities

Very odd question here but I've never seen any video explaining how flex cable displays actually work.

Asking for help in understanding the compatibilities of ribbon cables on displays. I have an display connected to a board using a 40pin connector.

The display is working correctly but if i wanted to swap it out with this? Why could/couldn't I do this?

Displays all seem to have drivers built into the display, Do these need to match?
Are all display different and won't work without reworking the code base?
What should i be looking for in terms of compatibility to allow different sizes(not resolutions) or shapes of screens?

If i found a screen that has a 40pin ribbon cable AND all pinouts match AND the driver chip is the same AND is the same resolution. Would these screens then be a match assuming the connected device could supply the power...?

I understand this is a very broad question but I have wondered about this for a long time.
This is not a question based on any Arduino project i am working on I'm just trying to understand something I've never found any information on.

(Lots of projects use screens bought with external circuits attached between the displays ribbon cable and Arduino but non explore why...)

Compare the datasheets for how the 40 pins are used. Are they the same? Just saying 40 pins might not be enough.

Probably. There's always something that can go wrong and that's why you have to test when switching suppliers. But short of the manufacturers claiming compatibility with each other, that's about as close as you can match them.