adverb
selfishly; without permission; on one's own accord
Describes acting on one's own judgment or desire, often disregarding others' wishes or rules. Can be neutral ('voluntarily') or negative ('selfishly').
彼は勝手に私の部屋に入った。
He entered my room without asking.
ドアが勝手に開いた。
The door opened by itself.
From 勝手 (katte, 'one's own convenience' or 'kitchen') + adverbial particle に. The sense of 'selfishly' developed from the idea of doing things according to one's own convenience.