This piece by Tolkien scholar Michael Martinez attempts to shed some light on the ultimate source of the ancient enmity between elves and dwarves.
MANY strongly-worded opinions have been written about the apparent enmity between Elves and Dwarves in The Lord of the Rings, although there is hardly any reference to such enmity in the story. Legolas and Gimli get off to a poor start but eventually become such close friends that it is considered remarkable. The debates begin with a rather brief passage found in “The Council of Elrond” in The Fellowship of the Ring, where Legolas tells how Gollum was taken from the Elves of Mirkwood:
‘…But Gandalf bade us hope still for his cure, and we had not the heart to keep him ever in dungeons under the earth, where he would fall back into his old black thoughts.’
‘You were less tender to me,’ said Glóin with a flash of his eyes as old memories were stirred of his imprisonment in the deep places of the Elven-king’s halls.
‘Now come!’ said Gandalf. `Pray do not interrupt, my good Glóin. That was a regrettable misunderstanding, long set right. If all the grievances that stand between Elves and Dwarves are to be brought up here, we may as well abandon this Council.’