Trade-off among statistical tests I was reading up on the KS test and I got a doubt why is it not okay to check with this test when there is a statistically significant difference between the two samples:

*

*Sample 1, taken from t=1 to 100 and

*Sample 2, taken from T=51 to 150

I'm having difficulty in reasoning about this. Any help would be highly appreciated.
 A: A more complete description of your data and objectives would be
required for a full discussion of your question. (Above, @RichardHardy has mentioned that your samples seem to overlap. In a comment on this Answer, @whuber has mentioned that independence cannot be assumed among observations in a time series. You would need to address both of these issues.)
However, even in many situations with disjoint, independent random samples,
I would use the 2-sample Kolmogorov-Smirnov test only if no other appropriate tests
are available.
In particular, I would not use a Kolmogorov-Smirnov test in preference
to a Welch t test to look for a difference in means. In many situations, the K-S test is too
reluctant to declare differences.
between two normal samples.
Differences in means, significance level: For example if I have independent, random samples of sizes 100 and 50 from the same normal
population, the K-S test rejects a test at the nominal 5% level more like
4% of the time. By contrast, a Welch two-sample t test rejects very nearly
the anticipated 5% of the time. In the simulations below with 100,000 tests
of each type, one can expect about two place accuracy for rejection probabilities.
set.seed(2021)
pv.ks = replicate(10^5, ks.test(rnorm(100),rnorm(50))$p.val)
mean(pv.ks <= .05)
[1] 0.04117
pv.wt = replicate(10^5, t.test(rnorm(100),rnorm(50))$p.val) 
mean(pv.wt <= .05)
[1] 0.04931

Differences in means, power. Even worse, for the same sample sizes as before, the K-S test
has power only about 67% to detect a difference between sampling from $\mathsf{Norm}(0,1)$ for the larger sample and from $\mathsf{Norm}(.5,1)$ for the smaller sample.
By contrast, the Welch t test has power about 81% for the same task.
set.seed(207)
pv.ks = replicate(10^5, ks.test(rnorm(100),rnorm(50,.5,1))$p.val)
mean(pv.ks <= .05)
[1] 0.66591
pv.wt = replicate(10^5, t.test(rnorm(100),rnorm(50,.5,1))$p.val) 
mean(pv.wt <= .05)
[1] 0.81416

Difference in variances, power. If we are looking at two normal samples of size 20 to detect a difference
between variances $\sigma^2=1$ and $\sigma^2=4.$ then the usual F-test,
implemented in R as var.test--hardly known for its good power--finds
a difference with probability about 84%, but the K-S test is much worse with power below 12%.
set.seed(1234)
pv.ks = replicate(10^5, ks.test(rnorm(20),rnorm(20,0,2))$p.val)
mean(pv.ks <= .05)
[1] 0.11434
pv.f = replicate(10^5, var.test(rnorm(20),rnorm(20,0,2))$p.val) 
mean(pv.f <= .05)
[1] 0.83552

