I find my accent changes unintentionally. My grandparents are quite posh so when I'm with them I usually pronounce all my 'T's and generally dumb down my accent. When I'm with my close family, friends or people with a strong accent I speak pretty normal, and if I'm in something like an interview for college or a job or something, again, I dumb down my accent.
I don't know why, I don't actually mean to, it just happens