Usage patterns
〈物〉がひとりでに〈動詞〉for a thing to (do something) on its own, with no one touching it
In the middle of the night, the door suddenly opened by itself.
〈事〉がひとりでに治るfor something (like an injury or problem) to heal or resolve on its own
Small cuts often heal on their own.