Why is it change one at a time instead of all together

I want to make a apple picking script and make them all brown when you pick them but for some reason when I have this part of the script

			wait(5)
			debounce = false
			v.Size = Vector3.new(1,1,1)
			v.BrickColor = BrickColor.new("Bright red")

this happens:
image
but when I remove it all of them are brown
image

here is the script

local apple_models = script.Parent.Parent.Parent.Apples
local apples = apple_models:GetDescendants()

debounce = false

script.Parent.TriggerEnded:Connect(function(player)
	if debounce == false then
		for i, v in pairs(apples) do
			print("picking apples")
			script.Parent.Enabled = false
			debounce = true
			v.BrickColor = BrickColor.new("Brown")
			local appleSize = v.Size
			v.Size = Vector3.new(0.75,0.75,0.75)
			wait(5)
			debounce = false
			v.Size = Vector3.new(1,1,1)
			v.BrickColor = BrickColor.new("Bright red")
		end

That wait(5) call causes the thread to yield.

for i, v in pairs(apples) do
	task.spawn(function()
		print("picking apples")
		script.Parent.Enabled = false
		debounce = true
		v.BrickColor = BrickColor.new("Brown")
		local appleSize = v.Size
		v.Size = Vector3.new(0.75,0.75,0.75)
		wait(5)
		debounce = false
		v.Size = Vector3.new(1,1,1)
		v.BrickColor = BrickColor.new("Bright red")
	end)
end

task.spawn spawns (creates) additional threads to handle code execution.