Paired-end illumina sequencing
Let me begin in the sample preparation to explain you the index primers.... and let me assume please that you want to sequence amplicons like 16S. Let me further assume that you have 96 samples, which means that you have one complete PCR plate full of samples. First you prepare your samples. You are doing a amplicon PCR, clean that PCR, attach the adapters which are necessary that the sequences can bind to the glas slide and at last you are attaching indexes. 
You are attaching these barcodes individually for each sample.
Looks like that image:



source: https://www.neb.com/~/media/Catalog/All-Protocols/C411AB12AFB04000BED567FC17B2A4AA/Content/PCRPlate.jpg


Let's call such indices barcodes (index = barcode). As you can see, each sample gets its own combination of a indexing primer as you are using always to primers (i7+i5) for each sample. Whats important is, is that all these primers are individuals like:

Line:
1: AAAAAT
2: AAAATT
3: AAATTT

and:
A: TTTGGG
B: TTGGGG
C: TGGGGG

(In reality these primers are longer and more complex!)


After you have done such a indexing PCR and also cleaned your PCR (get rid of the polymerase, something like this) you have to pool your samples (put them all together) before you are sequencing. And thats the point why such indexes are important. Without indexing you would have no chance to get your samples separated (=demultiplexed) again after sequencing. 

When you are sequencing paired-end then you are sequencing one time forward (barcode + adapter + the sequence you want to have) and one time reverse (barcode + adapter + the sequence you want to have). One big amplicon of e.g. 500 bps gives you two sequences: the forward sequence (also called forward read) and the reverse read. 

Let's call the forward read: R1
And the reverse read: R2


After sequencing you have one big pool of sequences. What you are doing first is to demultiplex your samples. As you know now you have for each samples hundreds of thousands of sequences: each consists of two Parts: The R1 read and the R2 read. What you are doing now is to separate your sequences again: You know that you used for example the indexing primers AAAATTTT and CCCCGGGG (just examples!) for your first sample. So you know that AAAATTTT belongs to the forward (R1) read and CCCCGGGG belongs to the reverse (R2) read. This means, that, when you separate all sequences which contains at the "barcoding/indexing-position" these sequences, you know that these are sequences which belong to your sample 1. For sample two you used for example the barcodes AATTAATT and CCGGCCGG and then you know again: AATTAATT belongs to the R1 read and CCGGCCGG belongs to the R2 read. Filtering that sequences out and save them in an additional file you will get your sample 2 separated. And that's why such indexes are important and that's also the reason why you always have to indexes: one is used for the forward read, and one for the reverse read. 

Additionally: Why basically we have to use primers is the following: If you want to sequence an amplicon you (or at least the machine) is only able to sequence about 250 bps in each direction. When you are attaching indexes (which are in each case needed) then you are able to sequence in both directions: forward and reverse. And afterwards, when you have demultiplexed your samples you can run an assembly to put the forward and reverse reads together again.