When using the API to update a resource it will cause multiple CustomAttribute values to be added to the custom_attribute_values table in the database.
So if currently have the custom attribute "Test Number" set to 1 for the resource. And then use the API to change it to a value of 2. In the custom_attribute_values table there will now be both entries stored. When using the web interface to edit the custom attribute it will delete the old value from the database table and then add new value.