On powerup, a memory test happens. During that test, for each of the tested memory blocks, a click is emitted from the speaker. If a key was pressed to skip the test, or the test was disabled in the settings, then it would sound all the clicks in a burst and continue the boot process.
Its hard to tell exactly from just that brief description, but I think you're probably referring to the sound of the hard drive head seek (repositioning to different areas of the disk) as data is read from the drive. That's the repetitive ticking you can hear in this video when the Windows 95 splash screen is showing and the OS is being loaded from the hard ...
Most likely the floppy drive and/or initializing on power up. The drives had to seek a few times to ascertain what track they were on or if there was a disk present. Most machines don't have floppies or indeed any spinning media, so this motor sound is absent from many new computers.
None quite as loud as the Apple II “machine gun”, though.