Why? Because the test statistic is calculated from the pooled variance from both samples, what makes sense only when we assume that both variances are equal.
This is the classical Behrens–Fisher problem, solved by Welch's test with degrees of freedom calculated using Satterthwaite's formula. The impact depends upon the variability in the variances and the sample sizes.
Expanding on what David Bristol said, when the sample sizes are equal, the ordinary pooled variance version of the unpaired t-test is very robust to heterogeneity of variance. Some authors say it is fine even when the ratio of larger:smaller variances is 4 or 5. (I suspect that is an underestimate.) But the more discrepant the sample sizes become, the more important it is to have homogeneity of variance (for the pooled variance version of the test), or to use the Welch-Satterthwaite 'unequal variances' version of the test that David mentioned. HTH.