The computer division is funded by the overall success of Apple. It allows the computer division to have a bigger budget to spend on things like marketing and R&D. It's not a coincidence that the computer division has been doing so much better since Apple had other mega-successes that serve as the cash cow for the entire company.
If the iPhone ever ceases to be as profitable it will have a ripple-effect throughout the entire company as they scramble to find the next thing that will replace those lost profits.
Actually, Apple spends remarkably little on R&D, perhaps even to a fault. The third chart on this page from Asymco [1] is interesting, especially considering Apple's R&D is for computers, phones, and whatever other lines they're developing, and the R&D for a company like HTC is likely to be clustered around its narrower product lines.
If the iPhone ever ceases to be as profitable it will have a ripple-effect throughout the entire company as they scramble to find the next thing that will replace those lost profits.