Are we just accidents that evolved over the millions of years?
Those are two different questions.
The first, actually two sentences, but all that in large, bold type, asks "Why?
The second is the by-line, which simply asks "How?". Mutations and adaptations are parts of the mechanics of the system, not the system itself.
If you are really asking "Why?", I do not think anyone can answer - no scientist, no theologian, no philosopher.
- If you are not religious, it is easy but discomfiting to think there is no real point of our existence, nor indeed that of the entire Universe.
- If you are religious, i.e. you believe some deity is creating and operating the whole lot, it's all simply to suit that deity, whatever it might be and whatever its motives - qualities we obviously cannot know either. Equally discomfiting!
Ultimately though, neither answer is any more satisfactory than the Mediaeval European clerics who placed Man at the pinnacle of God's work, in a geocentric cosmos based on Ancient Greek ideas. Theirs was a result of genuine lack of knowledge, and just basic arrogance; and used to stifle curiosity in what is really out there.
The simple truth is that we cannot say WHY everything in Nature exists!