Let us say we perform Wilcoxon signed-rank test on paired samples $x_{1,i}$ and $x_{2,i}$. I am trying to understand the independence assumption of the test. My questions are:
Which quantities must be independent? Is it $x_{1,i}-x_{2,i}$ or is it the ranks, $R_i$ of $x_{1,i}-x_{2,i}$? Alternatively, is it the signed ranks, $R_i \cdot sgn(x_{1,i}-x_{2,i})$?
Why is there a requirement for independence at all? My understanding is that Wilcoxon signed-rank test is based on a permutation test which requires exchangeability of data points. Since exchangeability does not necessarily require independence, then why does Wilcoxon signed-rank test require independence?
Does independence need to hold only for the null hypothesis or does it have to be true for alternative hypothesis as well?
What would happen if independence assumption was not met? I understand that if a requirement is not met, the $p$-values might be erroneous. I am looking for a more specific answer that describes how a step in conducting the test can go wrong in the absence of independence. A description with an example of a data that lacks required independence would be much appreciated.
How can we assess the impact of of autocorrelation in the data? For example, if there were autocorrelation of ~0.2 for lag=1 and ~0 for lag>1, how would it impact the significance level and power?