Welcome to HCM.
It could be an encysted hydrocele
Any mass lesion in the scrotum
needs to be investigated irrespective of it's being painful or not. It is unlikely to be varicocele
which feels like a bag of worms.
Since there is no known history of trauma it is unlikely to be a haematoma
You will need a Colour Doppler Scan of scrotum to determine whether it is cystic or solid or of mixed consistency and accordingly it will need to be treated.
Wish you all the best.