Humanity has multiple functions. It's kind of a form of currency. You use it to Kindle fires or Reverse Hollowing. Being Hollow is being Undead. Reversing this makes you Human, and costs 1 Humanity.
When Human, you can be invaded, but you can also summon phantoms (NPCs or other players) to help you.
Kindling a fire makes it give you 10 Estus Flasks upon resting there instead of 5. This costs 1 Humanity, but you have to be Human to Kindle. So if you are Hollow (Undead form) it costs 2 to Kindle; 1 to Reverse Hollowing, 1 to Kindle.
Humanity also affects item droprate. Your base Item Discovery is 100. This is just a percentage multiplier. Think of it as 100% or a 1.00 multiplier for each item's individual droprate. Having one Humanity (shown in the counter next to your health, not the on-use items - you have to use them to actually gain Humanity) increases your ID to 120, or a 1.20 multiplier. I don't know how much each additional point of Humanity increases this, but there's a chart somewhere. I think at 15 Humanity, my ID was around 180.
Humanity is lost and recovered along with your souls when you die, so there is some risk to having a lot of Humanity used. It's common to just store the consumables and use them to Reverse Hollowing and Kindle. Typically, unless I'm farming, I stay around 1 Humanity for that initial 20% boost.