While brain size is not a certain sign of intelligence, it is correlated with intelligence, especially when the comparison is done between more closely related animals, which have similar brain structures.
The largest brains belong to elephants and cetaceans, and both are among the most intelligent animals. However comparing their brain size to that of primates would not provide useful information, because for both elephants and cetaceans large parts of their brains are dedicated to the control of various functions of their large bodies that we do not consider as relevant for "intelligence", including things like trunk control and echolocation.
The largest brains belong to elephants and cetaceans, and both are among the most intelligent animals. However comparing their brain size to that of primates would not provide useful information, because for both elephants and cetaceans large parts of their brains are dedicated to the control of various functions of their large bodies that we do not consider as relevant for "intelligence", including things like trunk control and echolocation.