Dentist told me nothing is wrong with my teeth despite them hurting

Told me I have minor cavities and shouldn’t be feeling anything. Said pain I’m feeling is from grinding my teeth which I agree I do but how can they hurt randomally in the day then?