The creator of the game, Mihoyo has plans for some huge virtual game in future. Its going to be some virtual world of its own. Its going to be a huge project which has been acknowledged by the Chinese government as well.
I am not completely sure, but their aim is to help people with depression and some sort of brain related problems. Mihoyo is actively working with medical institutions and working on technologies regarding the same.
Simply put, Mihoyo is planning something huge and obviously they need huge amounts of money. Both Honkai Impact and Genshin Impact have been created with sole purpose for collecting revenue for their giant project.
Also both games are somewhat like prototypes of the final game. Mihoyo is testing out new technologies through these games. So, thats what Genshin Impact is, a really fun game to play, you can play it completely free if you want. But the game will make you spend money if you want some serious gaming experience, thats why its a gacha game.