small php script used in drupal module not clear with arrays in php
In your first section of code, that function is creating a form using Drupal's Form API and $form['beeps'] contains the settings for a single form element, in this case a textfield.  

The second function is the one is used to validate the form values and will display an error for any unacceptable value.

$beeps = $form_state['values']['beeps'] fills the variable $beeps with the value of the "beeps" textfield from the form generated in the first function.