Garrix, here, has followed a common transition -- from playing other people's records and getting a thorough understanding of how dance music works, to producing his own music. So, he is known as a DJ, but what he is doing when he makes music is producing.
Production covers a lot of activities, but it covers everything about turning an idea into a finished recording. Just to confuse matters, the idea might not fully exist before production starts. It's entirely possible that the recording and the songwriting happened in tandem.
It can be very hands on -- playing instruments, programming sequencers, actively setting up effects. Or it can be entirely supervisory; telling musicians and engineers what to do. And it can be collaborative -- the implication here is that Usher and Garrix worked together on the process of production.
The nearest you're going to get to knowing who wrote a song, is usually the credits. In this case, "Writers: Martijn Garritsen, Usher Raymond, James Abrahart" and "Producers: Martin Garrix, Usher Raymond"
One very likely scenario for a collaboration like this, between a DJ-producer and a singer-songwriter, is this: Garrix could have worked on an instrumental piece at home on a laptop. With this sounding OK, he could have sent an MP3 to Usher, who would have come up with a vocal melody and some words. Then they could have met in a studio, recorded the vocals, tweaked the instrumental, done some final mixing and polishing, to come up with a finished recording.
That's only one possible scenario. There are no fixed rules.