Apple Inc. and Google Inc. are racing to anticipate the needs of their users.

The technology giants, whose software runs nearly all of the world’s smartphones, are adding features to deliver information before users ask for it. Their moves suggest that smartphones will evolve into devices that dispense information unprompted.

The companies are tackling the technology differently, reflecting their own expertise and priorities. Apple’s Proactive Assistant, a feature of its forthcoming iOS 9 software, aims to learn how a user will behave from information stored on an iPhone. By contrast, Google Now combs data from a universe of online services and searches.

“This is a major battleground. The companies are using this to highlight their strengths,” said Rich Mogull, the chief executive of the research and advisory firm Securosis.

Both companies hope the new features, some of which are expected this fall, will keep their users loyal and lock them into related services that make money. For Apple, that means more returning customers for its iPhones. For Google, it means more engaged users for its advertisers.