Linux Software Compatibility
Ok I know there are lots of branches of linux and stuff and each distro has software compatible with it but some software compatible with one Distro may not be compatible with another Distro.
First of all is software written and compatible with Ubuntu compatible with all distros based off ubuntu such as linux mint and elementary os? Since Ubuntu is based of debian does that also mean all debian software can be run on ubuntu and all linux distros that branch of debian?
I've heard of linux distros having package managers... If a distro has a certain package manager such as pacman does that mean any distro with that package manager can run software obtainable with that package manager?
How many types of linux compatiblity are there and how do you determine what distros are compatible with what packages? I'm really confused about all this but would it be safe to say on the linux distro timeline that the 3 main distros "Debian", "Slackware" and "Redhat" are unable to run eachothers software and that all distros branching off them includes distros branching off distros branched of them are able to run their parents software?
For example Damn Small Linux branches off knoppix which branches off Debian. Does that mean any linux software for debian will run on damn small linux?
Really my question is how do you determine compatibility.
P.S Does old software eventually become in-compatible with newer systems? For example will software written for the first version of Debian still be compatible with the latest version of Debian?