Timer Interrupts on Due

StartTimer starts the timer. this function needs to be called once.
after Starttimer is finished, the (hardware) timer keeps running on it's own, without any need for code.
the timer counts up to a certain value, then generates an interrupt, starts with 0 and continues counting.

TC3_handler is called each time the interrupt of Timer/Counter TC3 (=timer 1 channel 0) is generated by the timer.
"TC3_handler" is a pre-determined functionname just like "setup" and "loop"
because TC3_handler is called for each interrupt, it is called as often as the timer hits that "certain value".
The lower that value the more often the TC3_handler is executed.

TC_Configure(tc, channel, TC_CMR_WAVE | TC_CMR_WAVSEL_UP_RC | TC_CMR_TCCLKS_TIMER_CLOCK4);
Read the datasheet paragraph 37.7.11, fields WAVE, WAVSEL, TCCLKS. TC_configure just sets bits in the TC_CMR register that belongs to TC3 (= Timer 1 channel 0 )

uint32_t rc = VARIANT_MCK/128/frequency; <---------- is VARIANT_MCK the frequency of arduino DUE(84MHz)? What does rc do?
Serial.Println(VARIANT_MCK,DEC) will enlighten. spoiler : yes
rc is the value the timer counts towards. it is that "certain value" I mentioned above.

TC_SetRA(tc, channel, rc/2); //50% high, 50% low<----sets the duty cycle?
yes, see datasheet 37.6.11.1, for instance.

TC_SetRC(tc, channel, rc);<---------- what is this line for?
it sets the value the timer counts towards. so it defines the frequency of the interrupts generated by the timer

TC_Start(tc, channel);<---------------enables PWM? How does it work?
no, it starts the timer. the timer begins incrementing now.

tc->TC_CHANNEL[channel].TC_IER=TC_IER_CPCS;<----------What does this line do?
I'm not sure but I think it sets the flag that specifies an interrupt is desired when timer = rc. IER = interrupt Enable Register

tc->TC_CHANNEL[channel].TC_IDR=~TC_IER_CPCS;<--------What does this line do?
IDR = interrupt disable register, all other interrupt-types supported by TC3 are disabled and will not occur.

NVIC_EnableIRQ(irq); <-----enables interrupt?
yes. it is the overall enabler, allowing interrupts to be generated by TC3.