title: What does Jetpack Compose remember actually do, how does it work under the hood?
body: <p>Checking out codelab's basic tutorial there is a snippet to increase counter on button when clicked</p>
  <pre><code>@Composable
  fun MyScreenContent(names: List&lt;String&gt; = listOf(&quot;Android&quot;, &quot;there&quot;)) {
      val counterState = remember { mutableStateOf(0) }
  
      Column(modifier = Modifier.fillMaxHeight()) {
          Column(modifier = Modifier.weight(1f)) {
              for (name in names) {
                  Greeting(name = name)
                  Divider(color = Color.Black)
              }
          }
          Counter(
              count = counterState.value,
              updateCount = { newCount -&gt;
                  counterState.value = newCount
              }
          )
      }
  }
  
  
  @Composable
  fun Counter(count: Int, updateCount: (Int) -&gt; Unit) {
      Button(
          onClick = { updateCount(count + 1) },
          colors = ButtonConstants.defaultButtonColors(
              backgroundColor = if (count &gt; 5) Color.Green else Color.White
          )
      ) {
          Text(&quot;I've been clicked $count times&quot;)
      }
  }
  </code></pre>
  <p>It is clear that <code>remember { mutableStateOf(0) }</code> stores the state/value. My question is what remember does under the hood. Using  <code>var count = remember { 0 }</code> or <code>mutableStateOf(0)</code> without <strong>remember</strong> does not increase the value.</p>
  <pre><code>fun MyScreenContent(names: List&lt;String&gt; = listOf(&quot;Android&quot;, &quot;there&quot;)) {
     
      var count = remember { 0 }
  
      Column(modifier = Modifier.fillMaxHeight()) {
          Column(modifier = Modifier.weight(1f)) {
              for (name in names) {
                  Greeting(name = name)
                  Divider(color = Color.Black)
              }
          }
          Counter(
              count = count,
              updateCount = { newCount -&gt;
                  count = newCount
              }
          )
      }
  }
  </code></pre>
  <p>Snippet above does not update the value printed on <code>Text</code>, does remember only work with <code>MutableState</code>?</p>