How do other inmates know about your sentence?

Often when there’s a crime committed and it’s incredibly serious, comments will say “he’ll get killed in prison” or “he won’t last a day”

How do other inmates know why you’re there? I thought there’d be bigger confidentiality of sentencing.