IMO Grok is the downstream consumer result of internal investment in AI at Twitter. One of the first things Elon did after buying was put all the useful APIs behind a paywall, which would be a reasonable first step if you bought it in part for the enormous training data the platform generates every day and wanted to limit competitors' access to it. Grok is then mostly just a way to get feedback on the tech.
Twitter and Tesla have two interesting datasets for AI.