Hello! Great question! Slightly is used as a more precise way of saying somewhat. For example, you would say you are "slightly" taller than your brother, but if you were just being general about it, you would say your are "somewhat" taller than your brother. Somewhat is also an informal way of saying it.
Hope this helps!