The trumpet creates sound with the use of a few different things: the way you form your form on the mouthpiece, the buttons pressed down at any time, and how much air is being blown into the trumpet. That’s about as technical as anything on the web gets that beginners can understand. For more information on the specifics, I would suggest talking to someone who knows the trumpet incredibly well and can make it easy for the beginners to understand.
That said, these change the sounds of the trumpet: which keys are pressed, if there’s a fourth valve, and if there’s a mute in the horn. The mute does pretty much exactly what it sounds like: it makes the sounds softer and quieter.