Why handset manufacturers releases new versions of android several months after Google? I have a nexus device. Whenever new version of android is released, the phone gets it almost instantly. I want to know why other manufacturers doesn't update their software in the same timespan. For some manufacturers, this process can take several months.

Is there a technical challenge that prevents them to do this? or is just matter of not allocating enough resources to do this? 

I know about the differences between different ROMs and manufacturers, UI layers and so on... I'm asking is if so difficult (and why), or if manufacturers just don't want to do it, to release the new ROMs earlier.

To give an example about what I'm saying: when I updated from Windows 7/8 to Windows 10 in several computers (MSI, Acer, Lenovo, and custom build), I just clicked the "update" button and all the computers updated fine, without drivers problems... Why android is not the same case? Every major release introduces several breaking changes that makes it difficult for manufacturers?
It may help to go through this graphic:

Notice that the graphic has a blue 'Google Play Edition' path which was when non-Nexus manufacturer had devices with only stock Android. This blue line would be the closest approximation to a Nexus device and notice how it doesn't have as many blocking points as the orange 'Carrier Device'.

Comparing to PC

You have to realize that the PC Hardware layer is relatively standardized on a x64 architecture either from Intel or AMD.

Android has multiple CPU architectures to support (ARMv7,ARMv8,x86,x64,MIPS) manufactured by different vendors (Samsung, Qualcomm, NVidia, Rockchip, Intel, MIPS) and its in Step 5 that the various vendors have to see what will get support. Way more customization goes on here than a normal PC.



Originally from:
http://www.htc.com/us/go/htc-software-updates-process/