What are Scripting languages used for in games?

So i like to learn by making games and recently found out about scripting languages and how they can help development but i’m not sure what scripting languages do for video games but a buddy of mine said they can be used for logic/UI/HUD designing.

I use java to hard code my games logic and XML to store data.

Can anyone explain what scripting languages are and what they do to help development?

and what scripting languages go along with java and are good/easy to learn?