I've heard it said many times on other sites that the actual copyright ownership applies to only words and melody, not the accompanying instruments, backing tracks, chord progressions, performance or anythhing else. Just words and melody. However, I have never been able to find where that has been written and have found other articles to the contrary. Never the less, lyrics and melody are part of the song and you are a co-writer.
If you're in the US, start here:
US Copyright Office Circular 1
and peruse the rest of the site. You won't find the actual laws and you don't really want to read them, but the circulars will answer most/all of your questions.
Also, if you co-write a song with someone, it's best to have an agreement beforehand. Usually 50/50 no matter how much more one person does than the other. But you can agree to different amounts.
Here are some examples:
If somebody handed me some lyrics and asked me to put it to music. That person gets credit for writing the lyrics and I get credit for writing the music. Lyrics by Somebody, Music by Chili.
If I rewrite some of those lyrics to better fit the music (which happens often in my case), then I get partial credit for writing the lyrics:
Lyrics by Somebody and Chili, Music by Chili.
If I sit down with someone who has a guitar and we bang out a song, we both wrote the words, or helped write the words, I sang the melody and he did the chords, then Words and Music by Somebody and Chili.