This is an example of how the agreement of the past particle works with the auxiliary "avoir" (have), "j'ai" at the first person singular. The agreement of the past particle with the auxiliary "avoir" works with the direct object, at one condition: the direct object must be place before the auxiliary to have an agreement. In the first sentence the direct object "des fleures" (feminine, plural) is place after the auxiliary "avoir". This is why the participle "cueillir" is just written "cueilli" and does not take in account the gender and quantity of the direct object. In the second sentence "des fleures" is replaced by "les" (considered a defined article in French), which is placed before the auxiliary. in this example we see that "cueillir" becomes "cueillies", the direct object is place before "avoir".