You use "at the end" when referring to a specific time or location,
"at the end of the movie, there was a very predictable plot twist."
whilst "in the end" is means "in conclusion"
Just like the title of the Linkin Park masterpiece, "In the end".
This is bit of an odd example , but it might help explain the points above.
"In the end, I'm glad we went to see the movie today, but I feel that at the end there could have been a better plot twist".