Questions about snakes and Athena

Does someone know why in most statues Athena is accompanied with a snake and/or her aegis is trimmed with them?. In the former case, Wikipedia mentions the association with her in the myths and Herodotus' account of one living in a crevice in the Acropolis.