How Do Custom Support So Many Phones? The other day, my friend told me that completely stock Android could run as a ROM on any device you care to mention. Since basically everyone else has told me otherwise, I decided to verify his claim and stumbled accross this Android Enthusiasts StackExchange thread. 

I accepted the answer that was marked as correct, but it got me thinking. If stock android cannot be run on any device, how do custom ROMs like CyanogenMod or anything else support so many phones? Thanks.
CyanogenMod/LineageOS and other custom ROMs can't run on every device either. They have different versions for different devices. For example check this list for the newest LineageOS-compatible devices.

The same version can't work on every device, because the operating system (in this case the android) have to include the drivers for the specific device it will ran on. An android version which would include all the drivers would be illogically huge.