i don't understand this

why can carboxyl and phosphate groups act as acids? as in, what makes an acid?