Installing windows is really an art these days. In addition to being installed plumb, square and level, drainage must be factored into the equation. Installing the right size flashing and properly installing the housewrap can make or break a proper installation. When choosing a window or siding professional, make sure they know what they are doing!
On this particular project, had housewrap been installed, the water would have stopped there and drained out at the bottom of the siding. The sheathing would have been dry and not had the chance to rot.
Improperly installed housewrap can also be a problem! I've seen a project where siding was installed by one of my competitors where the top layer did not lap over the bottom layer, it was the opposite. When some of the caulk joints failed water ran down the housewrap but was directed inside the wall. Once the drywall was removed, the problem was apparent. The only option was to remove the siding and start from scratch. I'll explain WHY the caulk joints failed in another post.
I guess the moral of the story here is to make sure you check your caulking on a regular basis. Look at the metal flashing over your windows and doors. Does it actually go the entire length of the trim board? If not, you are probably getting water beneath your siding.