Why do two different population sizes result in nearly equal sample sizes? I have calculated the sample size for two different populations, N1= 29414 and N2= 625 (see code below). Why do I almost get the same sample size n1= 380 and n2= 239. There is not much difference, although the population size is very different...
#z-score (confidence level) 95%
z = 1.96

#Sample proportion)
p = .5

#Margin of error
e = .05

#population size
N1= 29414
N2= 625


# calculate sample size for finite population
Sam= function(z, p, e, N) {
  n = (z^2*p*(1-p)*N)/(z^2*p*(1-p)+N*e^2)
  return(n)
}
Sam(z,p,e,N1)


This is really just a comment, but I'll post it as an answer to be able to include the code and plot.
One thing that might yield some insight would be to plot the Sam result from the function, across a range of population N values.
z = 1.96
p = .5
e = .05

Sam= function(z, p, e, N) {
  n = (z^2*p*(1-p)*N)/(z^2*p*(1-p)+N*e^2)
  return(n)
}

M = c(1, 3, 5, 10, 20, 50, 100, 200, 500, 1000, 3000,
      1e4, 3e4, 1e5, 3e5, 1e6, 3e6, 1e7)

n = length(M)
Y = rep(NA, n)

for(i in 1:n){
 Y[i] = Sam(z,p,e, M[i])
}
plot(M, Y, xlab="Population N", ylab="Sample size", log="x")


