There’s a general rule about consumer electronics: The older a device becomes, the more competitors appear and prices fall. This was true for televisions, personal computers and portable music players.

It was supposed to happen with smartphones. But the iPhone has defied gravity.

On Tuesday, Apple will unveil the 17th iteration of its flagship product. Remarkably, at an age in which most consumer devices have lost some of their appeal to users, Apple has increased its share of smartphone sales over less expensive rivals.