Actually there's no difference in terms of how sharing code is handled. Both Copilot and AI Assistant send your code to a LLM, and neither of those tools will use your code for training code generation models.
The difference is Microsoft owns the model and they have control over the processes that work with our data. We have to take it under faith that you are protecting your users from the undisclosed third parties our data is being submitted to.