Jazz - Couldn't understand anything

I couldn’t understand anything of UNQ_C1 of this assignment.
How this djmodel function works?
What is the architecture of the model?
Why we using reshaper?
Why we using Dense layer here in LSTM?
Why we iterating over all the timesteps in the for loop?
After following the instructions mentioned, I was able to code up this cell and passed all test cases but couldn’t understand anything.
Somebody please elaborate and/or provide additional resources to understand these concepts

The architecture of the model is in section 1.2 of the instructions.
We iterate over all the timesteps because that’s how an LSTM model works, and it’s how the data set is presented.