It's not unusual for Apple to build the pieces it needs for "moonshot" efforts (e.g. a search engine good enough to replace Google) over the course of many years. Apple likely started thinking about this over a decade ago, and you can see precursors in things like Siri suggestions and search, App Store and Apple Music search, Apple Photos search, etc.