Gallium is expensive to extract because it is extremely diluted in the environment.
It accompanies in very low quantities aluminum and zinc, so it is extracted only in the mines of aluminum or of zinc, as a byproduct.
However, the abundance of gallium is similar to that of lithium, while gallium is used in smaller amounts, so there is no risk to not have enough gallium in the near future.
On the other hand, all semiconductor devices with gallium also use some indium. Indium is used in even greater quantities in all LCD or OLED displays, to make transparent electrodes.
Indium is an extremely rare element in the entire universe, comparable with gold, so for indium there is a much greater risk that its reserves will become insufficient.
This could be mitigated by extracting such critical elements from the dumped electronic devices, but this is very expensive, because only small amounts of indium are used per device, so very large amounts of garbage would have to be processed in order to extract a sizable amount of it.