A music publisher is simply in the business of handling and exploiting musical compositions (aka musical works / songs).
This includes, but is not limited to:
And generally sourcing opportunities for the songwriters they represent.
How is this different to a record company?
Record companies deal with sound recordings OF music works, not the musical works themselves.
Do you need a publisher?
At very least, if you are a songwriter, you need to make sure you are collecting all the publishing you are owed.
If you haven’t been approached by a publisher, you can use a publishing admin service to handle that side of the business for you.