TL;DR: If a mixing or mastering engineer considers his/her contribution to be so significant that they actually contributed to the COMPOSITION or LYRICS or ARRANGEMENT enough to warrant composer, lyricist or arranger credit and/or money, then they will have to negotiate this with the rights holders, to be acknowledged as a co-writer or arranger. It is often done in modern pop music co-authorship productions that credits and royalties are split between many people, by sharing composer, lyricist and/or arranger roles. You don't have to worry about DAW producers not getting their share.
I'll try to sum up the concepts in simple terms. How it's in practice, from a pop music point of view.
- MELODY is the composition. That's the song. Same melody, same song. Different melody, different song. The person who wrote the melody is entitled to COMPOSER CREDIT (and money).
- The melody i.e. composition may or may not have LYRICS that can be transcribed as "text" to go with it. The person who wrote the lyrics is entitled to LYRICIST CREDIT (and money).
- An ARRANGEMENT is a deliberate adaptation of that melody, giving a backdrop and context for the main story, often adding a harmonic and rhythmic realization. An arrangement can present the melody in a different light, different perspective. The person who wrote an arrangement, may be entitled to ARRANGER CREDIT and money if the composer agrees. You made a polka version of Happy Birthday with jazzy chords?? Ooh, how creative. You made an arrangement. You ask for arranger MONEY and CREDIT too? If the composer i.e. melody writer, or whichever company or other non-person currently holds the rights, thinks your ingenious polka jazz idea was worthless, you're not getting any.
- There is also a thing called PUBLISHER, whose original purpose was marketing the music by distributing sheet music and thus getting the music performed and heard. The publisher owns a lot of rights over melody and lyrics, and the money coming from the use of those.
- A PERFORMANCE is when some people play and/or sing the song, maybe an arrangement of it. A performer will get PERFORMANCE CREDIT in liner notes or a show brochure or something. Money is usually paid, because performing songs is work. Performers WILL NOT get any of the previously mentioned types credit or money.
- A performance can be simply enjoyed live, or it can be RECORDED. Or a recording can be constructed by click click clicking in a DAW such as AmateurTools. The recording is a permanent, "mechanical" artifact that can be listened to over and over. It freezes a performance. The recording engineer WILL NOT get any of the previously mentioned credit or money. They did not compose, write lyrics, arrange, publish or perform.
- A recording of a performance or click-click-clicked set of WAV files or watever, can be MIXED. The purpose of mixing is to bring out the best and relevant parts of the recording in a way that serves the result the best. Is the bass too loud? Can you understand the lyrics? Is it desirable for this piece of art that lyrics even should be heard intelligibly? This is an artistic choice. Does the snare drum come out properly? Should it be made snappier? Should the guitars be drowned in reverb? Is the imaginary sound stage credible for this kind of music? The mixing engineer WILL NOT get any of the previously mentioned credit or money. They did not compose, write lyrics, arrange, publish or perform. Except if they did, which would make them a composer, lyricist or arranger, but conceptually, that wasn't mixing.
- A mixed version of a song can be MASTERED. The point of mastering is to adjust the mixed recording so that it can be enjoyed across as wide variety of end-listener equipment as possible. In the days of vinyl and CD media, mastering cared about things like, can this audio be actually put on a physical medium such as a vinyl disc. The mastering stage also used to be asked to make the result AS LOUD AS POSSIBLE AND THEN SOME, because the guys who paid the expenses for all this had the idea that louder is better. The mastering engineer WILL NOT get any of the previously mentioned credit or money. They did not compose, write lyrics, arrange, publish or perform.
You may think that you're "mixing" something. If in the process, you end up changing the melody and the lyrics considerably, it may not be considered the same song anymore. Ha ha ha py py birth birth day day to to to to. Were you allowed to do that? Maybe, but were you allowed to publish that nonsensical mutilation of a song? Will you get sued? Did you create a new composition or an arrangement or neither? Will you have to pay, or will you get rich? Who knows.
Let's address the literal question in the title.
Is mixing and mastering part of making the music OR is it just
creating a different performance or version of the music?
Conceptually, mixing is only mixing, as I explained the concepts above. Mastering is only mastering. Mixing and mastering are, conceptually, separate from song-writing, arranging and performing. It is possible that during a workflow phase that was called "mixing" in someone's project schedule, a person ended up making significant changes to a composition. They could easily even change the lyrics by, say, changing the order of words. But then, conceptually, the mixing engineer stepped outside the "mixing" area of responsibility.
If a mixing or mastering engineer considers his/her contribution to be so significant that they actually contributed to the COMPOSITION or LYRICS or ARRANGEMENT, then they will have to negotiate this with the rights holders, to be acknowledged as a co-writer or arranger. For mastering I think it's quite far-fetched, but it is entirely possible that in mixing, significant artistic contributions are made to the composition or arrangement. Quite often, in some countries at least, a mixing engineer can be given a track performance credit as if they had played an instrument. Well they did, the mixing console or AmateurTools. In some countries, this will result in a little bit of royalty money for the mixing engineer.