I don't see any kind of brackets on the 2 ends and that is probably why it let go, just to much pressure on the ends. This is a real easy fix. Clean the top of the wall so it's sqweeky clean, Install 4 new brackets and make sure they are fastened to the studding and are even with the top of the wall, then apply a top quality construction adhesive to the top of the wall then set the counter down on it and the brackets, screw the brakets into the countertop paying special attention the the length of your screws, sure wouldn't want them to long. add some weight on the countertop above where the wall is and let dry and then your good to go.