Probably the decisive difference is that the web needs to be delivered over network, while the OS is installed once and then is just there. If everyone needs to download your very special implementation of an otherwise pretty common type of widget, it becomes a nuisance and a waste of bandwidth.
But libraries can be GET'ed from common URLs and cached!