Perturbation theory is based on the notion of an asymptotic series. It differs to some extent from the idea of a Taylor series, which is an infinite sum of terms converging to the function it represents within a certain region. The expansion parameter of a Taylor series therefore need not be small.
An asymptotic series on the other hand is truncated to have a finite number of terms. Provided that the expansion parameter is small enough, one can truncate a Taylor series to get the asymptotic series. Terms that are excluded are then sufficiently suppressed to give negligible contributions.
This property also explains why perturbation theory works so well. If the subsequent terms are small enough then the terms that are retained in the series would be accurate enough.
Those issues that are raised in the comments about all the weird functions that exists are issues that may interest mathematicians, but they are not generally relevant in physics, because they do not describe things in the physical world. For example, it is often argued that such weird functions must also be elements in the sets over which path integrals are integrated. That is not true. The path integral, as used in physics, is purely based on an assumed solution for an integrant in Gaussian form. The question is then what would be the set of functions for which the functional integral would produce such a solution for a Gaussian integrant? It turns out that one can safely discard all such weird functions and still get the required solution.
In response to some comments, let me add some discussion about the divergence/convergence of asymptotic series. It is true that there are asymptotic series that have divergent tails. In other words, at some point beyond where one would normally truncate the series the terms can start to grow larger with the result that the series as a whole does not converge.
First, obvious not all asymptotic series are divergent in this way. A simple example is a Taylor series with a small expansion parameter within its convergence region. It can be used as an asymptotic series and it does not have a divergent tail.
The important question is, what about the asymptotic series in perturbation theory. In this case, we can use the scientific method. If the asymptotic series that we are using to compute a measurable quantity is one of those that diverge, then the experimental result won't agree with the computed result. So the fact that there is agreement between the computation and the measured result indicates that the series did not diverge.
It actually runs deeper than that. All divergences must cancel when one calculates a measurable quantity. If that does not happen, then the theory is useless. The fact that we can compute results that agree with the quantities we measure indicates that the asymptotic series is convergent. Even if there are terms at large orders that become very large, they must cancel among themselves to give negligible contributions. How this happens is very difficult to determine without actually calculating such higher order terms, which is simply not practically feasible.
In the end, the whole issue about the apparent divergences in asymptotic series in perturbation theory far beyond the truncation point is not a problem in physics. The calculation procedure works. Therefore, it is a problem in pure mathematics. Mathematician are trying to understand why it works.