Intelligence isn’t directly correlated with brain size, but rather the size of the brain relative to the size of the thing it’s in. For all we know, water is 99% brain, making it far more intelligent than humans.