The strength of the signal and how much noise/congestion there is on the frequency you are operating. Strength of signal is based on your antennas (their power, gain and the pattern they send signal) , distance, and objects like walls in the way that block and bounce signal. Congestion is caused by many things. Common examples are multiple users in the area, microwave ovens, bluetooth devices, and devices tuned to nonstandard channels causing issues in multiple adjacent channels.
Also, what ‘standard’ you are running at. 5G runs at a higher frequency and at close range is faster, but can’t penetrate walls and other obstacles as good as 2.4. 2.4 might actually be faster at the the edge of where 5G can reach like at 100 feet away, for example.
There also are some tricks like channel bonding which will give you multiple “pipes” of bandwidth using 2 or more channels to double your bandwidth or more.