Schiff base formation is also pH dependent, being most effective at pH ~4 and 8. Its a balance between protonating the carbonyl to make it electrophilic, vs not protonated the amine too much with acidic conditions. With the basic conditions, its about allowing the amine to be a good nucleophile by not having it be protonated at all. Its a complex interplay of factors that varies from substrate to substrate, but pH certainly has a strong effect on this equilibrium dependent reaction.