Normally, a variable is a place to store a value. You assign a value to the variable (var="some value"), and after that you can recall the value with a variable expansion (writing "$var" is equivalent to writing "some value").
It's possible to make variables that do something special when you assign a value to them, or in other circumstances where the shell accesses variables. An attribute on a variable is an annotation that the shell stores next to the variable's name and value, which tells the shell to apply this special behavior.
One example
For example, declare -i x tells the shell that x must contain integer values only. Normally, when you assign a value to a variable, the shell takes the string that results from expanding the right-hand side of the equal sign and stores it as the variable's value. But if the variable has the integer attribute, the shell parses that string as an arithmetic expression and stores the result of evaluating that expression. For example:
$ x=2+2; echo $x
2+2
$ declare -i x; x=2+2; echo $x
4
$ declare -i x; x=2+hello; echo $x
2
$ declare -i x; x=2+
bash: 2+: syntax error: operand expected (error token is "+")
(The third line with x=2+hello sets x to 2 because hello is a variable name which is not defined, and unset variables are silently interpreted as 0 by default.)
Likewise, declare -l var declares that var must contain lowercase letters only. When the shell stores the value of the variable, it converts any uppercase letter to lowercase. declare -u var does the conversion in the other direction. declare -r var makes var read-only, which is also a special behavior of assignment: it causes every subsequent assignment to var to fail.
More examples
declare -x var causes var to be exported to the environment. For this attribute, the special behavior happens when bash runs an external command: external commands see an environment that contains the variables that the shell is exporting at the time the shell runs the external command.
declare -l vardeclares thatvarmust contain lowercase letters only. When the shell stores the value of the variable, it converts any uppercase letter to lowercase.declare -u vardoes the conversion in the other direction.declare -r varmakesvarread-only, which is also a special behavior of assignment: it causes every subsequent assignment tovarto fail.declare -x varcausesvarto be exported to the environment. For this attribute, the special behavior happens when bash runs an external command: external commands see an environment that contains the variables that the shell is exporting at the time the shell runs the external command.