# Why doesn't gambler's fallacy apply here?

Q: A card is drawn & replaced in an ordinary pack of 52 cards. Find the minimum number of times a card must be drawn so that there is at least an even chance of drawing a heart.

Every time the probability is 1/4 (since the card is replaced), so why would the previous outcomes or number of times I'm drawing a card affect the probability of drawing a heart?

You are misinterpreting the problem. The question is not asking you to determine the probability that the next card is a heart (as you point out, this will always be $\frac{1}{4}$). Rather, it is asking you how many cards you have to draw so that the probability of having drawn at least one heart is greater than $\frac{1}{2}$.
Alternatively, you can consider the complementary event. How many cards do you have to draw so that the probability of having drawn no hearts is less than $\frac{1}{2}$. Since each draw is independent, the probability of having drawn no hearts by the $k$-th draw is $$P(\text{no hearts in k draws}) = \left(\frac{3}{4}\right)^k.$$ We want to find $k$ such that $$P(\text{no hearts in k draws}) < \frac{1}{2},$$ so we can solve $$\left( \frac{3}{4} \right)^k < \frac{1}{2} \implies k \log\left( \frac{3}{4} \right) < \log\left( \frac{1}{2} \right) \implies k > \frac{ \log\left( \frac{1}{2} \right) }{ \log\left( \frac{3}{4} \right)} \approx 2.4$$ (note that $\log(3/4) < 0$, hence the inequality reverses when we cancel that term). This means that we have to draw at least 2.4 cards to obtain even odds of having seen at least one heart. Since we can't draw fractional cards, round up (since we have to draw more than 2.4 cards) to get 3.