It's very difficult with kids and phones.
We have our phones out all the time, the kids see us checking things on them. They look at pictures we have taken on them - it is just seen as normal.
There are parents of 8 and nine year olds who let them have old phones and the peer pressure starts ticking from about year four onwards in schools.
Generally speaking, these are expensive bits of kit at up to a certain age it is quite the norm for mum/dad to be able to look through browsing history and texts etc. with the agreement that things shouldn't be deleted or cleared. Some parents have this for laptops and PCs at home. The adult is normally the bill payer and can withdraw the funding after all! The flipside to that is to come and talk to you / show you when they find abusive / unpleasant / nasty things.
https://www.thinkuknow.co.uk/ is a really good site
https://ceop.police.uk/ is there for the hard hitting stuff
No dis-respect to teachers, but e-safety teaching can be very patchy. Subject knowledge varies greatly and sometimes it is done by having an e-safety day or week and if your niece was off that day or missed a lesson, she might have missed all the important stuff.
It's really good that you're concerned. Talk to her about it, there is also the flipside of getting drawn into making unpleasant posts or having at go online. It can get you into a lot of trouble at school and blot your copy book big time.
Good luck